<script setup>
	import { getMyOrderListService } from '@/api/order'
	import { ref } from 'vue'

	const tableData = ref([])
	const orderList = async () => {
		let result = await getMyOrderListService()
		console.log(result.data)
		tableData.value = result.data
	}
	orderList()

	const handleState = (index) => {
		if (tableData.value[index].state == true) {
			return '已处理'
		}
		return '未处理'
	}
</script>

<template>
	<el-table :data="tableData" style="width: 100%">
		<el-table-column label="更新日期" width="300" prop="updateTime">
		</el-table-column>
		<el-table-column label="商铺编号" width="120" prop="storeId">
		</el-table-column>
		<el-table-column label="材料编号" width="120" prop="id">
		</el-table-column>
		<el-table-column label="数量" width="120" prop="quantity">
		</el-table-column>
		<el-table-column label="处理状态" width="120" prop="state">
			<template #default="scope">
				<div>{{ handleState(scope.$index) }}</div>
			</template>
		</el-table-column>
	</el-table>
</template>

<style scoped></style>
